package com.alan.validate.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class EmailValid {

	public static boolean isEmail(String email) {
		if (email == null) {
			return false;
		}
		Pattern p = Pattern.compile(
				"^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
		Matcher m = p.matcher(email.toString());
		return m.matches();
	}

}
